


*Set working directory
*cd "SET WORKING DIRECTORY HERE"
use "PSRM_Dataset_Grapevine Effect.dta", clear


*** FIGURE 1 ***
*** use dataset "PSRM_Dataset_Grapevine Effect"

catplot d11_exp country if d11_dummy==0, stack vertical asyvars title("Control Group (n=1,939)") ytitle("Observations") name(graph_1)
catplot d11_exp country if d11_dummy==1, stack vertical asyvars title("Treatment Group (n=1,931)") ytitle("Observations") name(graph_2)
graph combine graph_1 graph_2

graph save Graph "Figure_1.gph"



*** FIGURE 2 ***
*** use dataset "PSRM_Dataset_Grapevine Effect"

label define fff 0 "Control" 1 "Treatment"
label values endorse1_dummyb fff

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)
margins endorse1_dummyb, at(date_wave2==(0(5)40))
marginsplot, title("") xtitle("Days since first interview in commune")

graph save Graph "Figure_2.gph"



*** FIGURE 3 ***
*** use dataset "PSRM_Dataset_Grapevine Effect"

gen ethmarryd=.
replace ethmarryd=0 if ethmarry==1
replace ethmarryd=1 if ethmarry==2
replace ethmarryd=1 if ethmarry==3

areg endorse1_expd i.ethmarryd##c.date_wave1 if wave==1, absorb(target_zone) cluster(target_zone)
margins, dydx(ethmarryd) at(date_wave1==(0(5)30))
marginsplot, title("Survey 1") xtitle("Days since first interview in commune") name("g43")

areg endorse1_expbd i.ethmarryd##c.date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)
margins, dydx(ethmarryd) at(date_wave2==(0(5)40))
marginsplot, title("Survey 2") xtitle("Days since first interview in commune") name("g44")

graph combine g43 g44

graph save Graph "Figure_3.gph"




use "Corstange raw data_Grapevine Effect.dta", clear

*** FIGURE 4 ***
*** use dataset "Corstange raw data_Grapevine Effect"

gen day=.
replace day=0 if q1=="6/29/2011 0:00"
replace day=1 if q1=="6/30/2011 0:00"
replace day=2 if q1=="7/1/2011 0:00"
replace day=3 if q1=="7/2/2011 0:00"
replace day=4 if q1=="7/3/2011 0:00"
replace day=5 if q1=="7/4/2011 0:00"
replace day=6 if q1=="7/5/2011 0:00"
replace day=7 if q1=="7/6/2011 0:00"
replace day=8 if q1=="7/7/2011 0:00"
replace day=9 if q1=="7/8/2011 0:00"
replace day=10 if q1=="7/9/2011 0:00"
replace day=11 if q1=="7/10/2011 0:00"
replace day=12 if q1=="7/11/2011 0:00"
replace day=15 if q1=="7/14/2011 0:00"

bysort q2: sum day

gen date2 = day
replace date2 = date2-2 if q2==1
replace date2 = date2-0 if q2==2
replace date2 = date2-0 if q2==3
replace date2 = date2-1 if q2==4
replace date2 = date2-1 if q2==5
replace date2 = date2-0 if q2==6
replace date2 = date2-12 if q2==7
replace date2 = date2-0 if q2==8
replace date2 = date2-3 if q2==9
replace date2 = date2-6 if q2==10
replace date2 = date2-8 if q2==13
replace date2 = date2-7 if q2==15
replace date2 = date2-7 if q2==16
replace date2 = date2-9 if q2==17
replace date2 = date2-9 if q2==18
replace date2 = date2-9 if q2==19
replace date2 = date2-11 if q2==20

gen treatment=.
replace treatment=0 if q4==1
replace treatment=1 if q4==2

replace q18=. if q18==-99
replace q18=. if q18==-98
replace q18=. if q18==99
replace q21=. if q21==-99
replace q21=. if q21==-98
replace q21=. if q21==99
replace q22=. if q22==-99
replace q22=. if q22==-98
replace q22=. if q22==99
replace q24=. if q24==-99
replace q24=. if q24==-98
replace q24=. if q24==99

egen support_hezbol = rowmean(q18 q21 q22 q24)

replace q7=. if q7==-99
replace q7=. if q7==99
replace q8=. if q8==-99
replace q8=. if q8==-98
replace q8=. if q8==99

gen shianeigh=0
replace shianeigh=1 if q30==3
replace shianeigh=. if q30==.
tab shianeigh

label define muh 0 "Minority Shia" 1 "Majority Shia"
label values shianeigh muh

areg support_hezbol c.date2 c.date2#shianeigh q7 q8, absorb(q2) cluster(q2)  // this might be best or we can use above and describe this in text
margins, at(date2=(1(3)15) shianeigh=(0 1))
marginsplot, title("") xtitle("Days since first interview in neighborhood")


graph save Graph "Figure_4.gph"



use "PSRM_RawData_Grapevine Effect.dta", clear



*** FIGURE A2 ***
*** use dataset "PSRM_RawData_Grapevine Effect"

label define uuu 1 "Not at all" 2 "Somewhat" 3 "A lot" 88 "Don't know" 99 "Refused"
gen d11_exp=b_d11traitement
replace d11_exp=b_d11controle if d11_exp==.
label values d11_exp uuu
gen d11_dummy=.
replace d11_dummy=0 if b_d11controle !=.
replace d11_dummy=1 if b_d11traitement !=.
label define xxx 0 "Control" 1 "Treatment"
label values d11_dummy xxx

rename id2 country
label define yyy 1 "Chad" 2 "Niger" 3 "Burkina Faso"
label values country yyy

catplot d11_exp country if d11_dummy==0, stack vertical asyvars title("Control Group (n=1,963)") ytitle("Observations") name(graph_X)
catplot d11_exp country if d11_dummy==1, stack vertical asyvars title("Treatment Group (n=1,954)") ytitle("Observations") name(graph_Y)
graph combine graph_X graph_Y


graph save Graph "Figure_A2.gph"

